package com.gaohe.scp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.scp.mapper.CsSettingMapper;
import com.gaohe.scp.domain.CsSetting;
import com.gaohe.scp.service.ICsSettingService;

/**
 * 系统设置Service业务层处理
 * 
 * @author liuxiangyu
 * @date 2025-03-25
 */
@Service
public class CsSettingServiceImpl implements ICsSettingService 
{
    @Autowired
    private CsSettingMapper csSettingMapper;

    /**
     * 查询系统设置
     * 
     * @param settingId 系统设置主键
     * @return 系统设置
     */
    @Override
    public CsSetting selectCsSettingBySettingId(Long settingId)
    {
        return csSettingMapper.selectCsSettingBySettingId(settingId);
    }
    /**
     * 根据type类型查询关于我们
     * */
    @Override
    public CsSetting selectCsSettingByType(String type)
    {
        return csSettingMapper.selectCsSettingByType(type);
    }

    /**
     * 查询系统设置列表
     * 
     * @param csSetting 系统设置
     * @return 系统设置
     */
    @Override
    public List<CsSetting> selectCsSettingList(CsSetting csSetting)
    {
        return csSettingMapper.selectCsSettingList(csSetting);
    }

    /**
     * 新增系统设置
     * 
     * @param csSetting 系统设置
     * @return 结果
     */
    @Override
    public int insertCsSetting(CsSetting csSetting)
    {
        csSetting.setCreateTime(DateUtils.getNowDate());
        return csSettingMapper.insertCsSetting(csSetting);
    }

    /**
     * 修改系统设置
     * 
     * @param csSetting 系统设置
     * @return 结果
     */
    @Override
    public int updateCsSetting(CsSetting csSetting)
    {
        csSetting.setUpdateTime(DateUtils.getNowDate());
        return csSettingMapper.updateCsSetting(csSetting);
    }

    /**
     * 批量删除系统设置
     * 
     * @param settingIds 需要删除的系统设置主键
     * @return 结果
     */
    @Override
    public int deleteCsSettingBySettingIds(Long[] settingIds)
    {
        return csSettingMapper.deleteCsSettingBySettingIds(settingIds);
    }

    /**
     * 删除系统设置信息
     * 
     * @param settingId 系统设置主键
     * @return 结果
     */
    @Override
    public int deleteCsSettingBySettingId(Long settingId)
    {
        return csSettingMapper.deleteCsSettingBySettingId(settingId);
    }
}
